<?php

namespace App\Http\Controllers\v1;

use App\Models\User;
use Illuminate\Http\Request;
use Illuminate\Http\Exception\HttpResponseException;
use JWTAuth;
use Tymon\JWTAuth\Exceptions\JWTException;
use Illuminate\Http\Response as IlluminateResponse;
use JWTFactory;
use App\Http\Controllers\Controller;
use App\DB\PermissionDB;

class MenuController extends Controller {
	/**
	 * Create a new controller instance.
	 *
	 * @return void
	 */
	protected $app;
	
	/**
	 *
	 * @param \Laravel\Lumen\Application $app        	
	 */
	public function __construct(\Laravel\Lumen\Application $app) {
		$this->app = $app;
	}
	
	/**
	 * 获取菜单
	 *
	 * @param Request $request        	
	 */
	public function downloadMenu(Request $request) {
		$menuTree = PermissionDB::getPermission ( $request->user (), 'menu' );
		return responseData ( $menuTree );
	}
}
